7d4c9c760156a8b74506d8bef55311cfe2a2b4f4,sagan-site/src/test/java/sagan/guides/support/DocsWebhookControllerTests.java,DocsWebhookControllerTests,testTutorialCacheEviction,#,98
Before Change
@Test
public void testTutorialCacheEviction() throws Exception {
given(this.tutorials.parseTutorialName("gs-test-guide")).willReturn("test-guide");
String payload = StreamUtils.copyToString(
new ClassPathResource("fixtures/webhooks/docsWebhook.json").getInputStream(), Charset.forName("UTF-8"));
ResponseEntity response = this.controller.processTutorialsUpdate(payload, "sha1=f808b2905e91e6a7a31526b9f44a95a5a7e3472a", "push");
assertThat(response.getBody(), is("{ \"message\": \"Successfully processed update\" }\n"));
After Change
@Test
public void testTutorialCacheEviction() throws Exception {
given(this.tutorials.parseTutorialName("gs-test-guide")).willReturn("test-guide");
String payload = StreamUtils.copyToString(
new ClassPathResource("fixtures/webhooks/docsWebhook.json").getInputStream(), Charset.forName("UTF-8"))
.replaceAll("[\\n|\\r]","");
ResponseEntity response = this.controller.processTutorialsUpdate(payload, "sha1=848E37804A9EC374FE1B8596AB25B15E98928C98", "push");
assertThat(response.getBody(), is("{ \"message\": \"Successfully processed update\" }\n"));